package pl.edu.agh.neural.simple.activation;

public class LogisticActivation implements IActivationFunction {

    private double parameter;

    public LogisticActivation(double parameter) {
        this.parameter = parameter;
    }

    @Override
    public double evaluate(double argument) {
        return (1.0 / (1.0 + Math.exp(-1.0 * parameter  * argument)));
    }

    @Override
    public double evaluateDerivative(double argument) {
        double value = evaluate(argument);
        return parameter * value * (1.0 - value);
    }
}
